package com.ncloud.act.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import com.ncloud.act.entity.ChnlAccessLog;

@Mapper
public interface ChnlAccessLogMapper{

	@Select("SELECT access_id, charge_id, chnl_id, old_deposit_money, money, new_deposit_money, access_tag, recv_time, recv_user_id, cancel_tag, cancel_time, cancel_user_id, remark FROM sys_chnl_accesslog "
			+ "where chnl_id =#{chnl_id} ")
	@Results({@Result(column="access_id",property="access_id"),
		@Result(column="charge_id",property="charge_id"),@Result(column="chnl_id",property="chnl_id"),
		@Result(column="old_deposit_money",property="old_deposit_money"),@Result(column="money",property="money"),
		@Result(column="new_deposit_money",property="new_deposit_money"),@Result(column="access_tag",property="access_tag"),
		@Result(column="recv_time",property="recv_time"),
		@Result(column="recv_user_id",property="recv_user_id"),@Result(column="cancel_tag",property="cancel_tag"),
		@Result(column="cancel_time",property="cancel_time"),@Result(column="cancel_user_id",property="cancel_user_id"),
		@Result(column="remark",property="remark")})
	List<ChnlAccessLog> getChnlAccessLogByChnlID(Long chnl_id);
	
	@Insert(value = "INSERT INTO sys_chnl_accesslog (access_id, charge_id, chnl_id, old_deposit_money, money, new_deposit_money, access_tag,adjust_id,recv_time, recv_user_id, cancel_tag, cancel_time, cancel_user_id, remark) "
										+ "values(#{access_id},#{charge_id},#{chnl_id},#{old_deposit_money},#{money},#{new_deposit_money},#{access_tag},#{adjust_id},#{recv_time},#{recv_user_id},#{cancel_tag},#{cancel_time},#{cancel_user_id},#{remark})")
    public int insertChnlAccessLog(ChnlAccessLog chnlAccessLog);
	
	/*@Update(value = "UPDATE sys_chnl_paylog SET deposit_money = #{deposit_money},update_time = #{update_time}, update_user_id = #{update_user_id} WHERE chnl_id = #{chnl_id} ")
    public int updateChnlPayLog(ChnlPayLog chnlPayLog);*/
}
